<template>
	<view class="article">
		<view class="article__title">{{article.text}}</view>
		<view class="article__content">
			<view class="article__content__image-box">
				<image class="article__content__image-box__image" :src="img" v-for="(img,index) in article.imageUrls">
					
				</image>
			</view>
			<view class="article__content__text">{{article.text}}</view>
		</view>
		<view class="article__footer">
			<view class="article__footer__viewNum">阅读量：{{article.viewNum}}</view>
			<view class="article__footer__date">发布时间：{{article.releaseTime}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				articleId:"",
				article:{}
			}
		},
		onLoad(){
			this.articleId=this.$Route.query.articleId
			this.getArticle()
		},
		methods: {
			getArticle(){
				let queryData={
					articleId:this.articleId
				}
				this.$Axios({
					url:this.$store.state.baseURL+"/article/info/access",
					method:"get",
					params:queryData
				}).then(response=>{
					if(response.data.state=="success"){
						this.article=response.data.msg
					}else{
						uni.showToast({
							title:response.data.msg,
							duration:2000,
							icon:"none"
						})
					}
				})
			}
		}
	}
</script>

<style lang="less">
.article{
	&__title{
		font-size: @uni-font-size-title;
		color: @uni-color-title;
		margin: @uni-spacing-row-lg @uni-spacing-col-lg 0 @uni-spacing-col-lg;
		padding-bottom: @uni-spacing-row-base ;
		border-bottom: @line-light-size solid @uni-border-color;
		
	}
	&__content{
		display: flex;
		flex-direction: column;
		margin-top:@uni-spacing-row-lg;
		margin-left: @uni-spacing-col-lg;
		margin-right: @uni-spacing-col-lg;
		&__image-box{
			
		}
		&__text{
			font-size: @uni-font-size-lg;
		}
	}
	&__footer{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		margin: @uni-spacing-row-base @uni-spacing-col-lg;
		color: @font-color-grey;
		margin-bottom: @uni-spacing-row-lg;
	}
}
</style>
